﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace QuanLyQuangCao
{
    public partial class frmGD_NV : Form
    {
        public frmGD_NV()
        {
            InitializeComponent();
        }
        private DataSet ds = new DataSet(); 
        private void frmGD_NV_Load(object sender, EventArgs e)
        {
            setdata();
        }

        private void btnTDTT_Click(object sender, EventArgs e)
        {

            frmGD_NV_Edit fNV_S = new frmGD_NV_Edit();
            fNV_S.pMaNV = dataGridView1.CurrentRow.Cells[0].Value.ToString();
            fNV_S.pTenNV = dataGridView1.CurrentRow.Cells[1].Value.ToString();
            fNV_S.pchkTT = Convert.ToBoolean(dataGridView1.CurrentRow.Cells[3].Value);
            fNV_S.ShowDialog();
            setdata();
        }
        private void setdata()
        {
            string sql = "select * from nhanvien";
            frmChinh.me.cn1.laydulieu(sql, frmChinh.me.sqlcon, ds, "nhanvien");
            dataGridView1.DataSource = ds;
            dataGridView1.DataMember = "nhanvien";
        }
    }
}
